From: Florian Müllner Date: Wed, 18 Mar 2015 22:54:25 +0000 (+0100) Subject: system: Do not disable suspend action when locked X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~850 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=2425b11df6d1d5725b58b47199f8985f82d9cd77;p=gnome-shell.git system: Do not disable suspend action when locked gnome-settings-daemon now allows the corresponding keybinding, so for consistency it makes sense to show the button as well. https://bugzilla.gnome.org/show_bug.cgi?id=725960 --- diff --git a/js/ui/status/system.js b/js/ui/status/system.js index 4981d948b..1d666cfb8 100644 --- a/js/ui/status/system.js +++ b/js/ui/status/system.js @@ -306,14 +306,17 @@ const Indicator = new Lang.Class({ }, _updateHaveSuspend: function() { - this._loginManager.canSuspend(Lang.bind(this, function(result) { - this._haveSuspend = result; - this._updateSuspend(); - })); + this._loginManager.canSuspend(Lang.bind(this, + function(canSuspend, needsAuth) { + this._haveSuspend = canSuspend; + this._suspendNeedsAuth = needsAuth; + this._updateSuspend(); + })); }, _updateSuspend: function() { - let disabled = Main.sessionMode.isLocked || + let disabled = (Main.sessionMode.isLocked && + this._suspendNeedsAuth) || (Main.sessionMode.isGreeter && this._loginScreenSettings.get_boolean(DISABLE_RESTART_KEY)); this._suspendAction.visible = this._haveSuspend && !disabled;